package com.huawei;

/**
 * Created by Z-hong on 2024/7/24.
 */
import java.util.*;
public class HJ92 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String str = sc.nextLine();
            getNumber(str);

        }
    }
    public static void getNumber(String str){
        String res="";
        int max=0;
        int i=0;
        int j=0;
        while(j<str.length()&&i<str.length()){
            char a=str.charAt(i);
            if (a>='0'&&a<='9'){
                j=i;
                while(j<str.length()&&str.charAt(j)>='0'&&str.charAt(j)<='9'){
                    j++;
                }
                if (j-i>max){
                    max=j-i;
                    res=str.substring(i,j);
                }else if((j-i)==max){
                    res=res+str.substring(i,j);
                }
                i=j;
            }else i++;

        }
        System.out.println(res+","+max);
    }
}
